/*
	i8254.h
	
	8254 programmable timer control code
	
	Meng Sun(c) leon.meng.sun@gmail.com
	Source code released under LGPLv3
	https://www.gnu.org/licenses/lgpl-3.0.txt
*/

#ifndef ISAMIPS_QEMU_I8254
#define ISAMIPS_QEMU_I8254

#include "board.h"

#define I8254_BASE ((unsigned char*)(ISA_IO_BASE + 0x40))

#define CTR0 *(I8254_BASE)
#define CTR1 *(I8254_BASE + 1)
#define CTR2 *(I8254_BASE + 2)
#define CONTROL *(I8254_BASE + 3)

void i8254Init(void);

uint32 getEpocCounterHi(void);

uint32 getEpocCounterLo(void);

void waitTillMillisecond(uint8);

#endif
